/**
 *
 */
package hb.software.student.group;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import edu.zut.hb.software.base.domain.BaseTreeEntity;
import hb.software.student.entity.Student;

/**
 * @author Mie
 *
 */
@Entity
@Table(name = "T_GroupStudent")
@NamedQueries({@NamedQuery(name = "GroupStudent.getRoot", query = "select g from GroupStudent g where g.parent is null")})
public class Group extends BaseTreeEntity<Group, Long> {

    /**
     *
     */
    private static final long serialVersionUID = 5965727204696398337L;
    @Column
    String code;

    @Column
    String name;
    @OneToMany
    List<Student> students;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<Student> getStudents() {
        return students;
    }

    public void setStudents(List<Student> students) {
        this.students = students;
    }
}
